/**
 * 
 */
package com.cait.dutyfree.pojo;

import java.io.Serializable;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToOne;
import javax.persistence.Table;

/**
 * @author Rasika Kaluwalgoda
 * 
 */
@Entity
@Table(name = "stocks")
public class Stock implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 4277057503283767417L;

	private Integer id;
	private Category category;
	private SubCategory subCategory;
	private Product product;
	private Integer quantity;

	/**
	 * @return the stockId
	 */
	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	public Integer getId() {
		return id;
	}

	/**
	 * @param stockId
	 *            the stockId to set
	 */
	public void setId(Integer id) {
		this.id = id;
	}

	/**
	 * @return the category
	 */
	@OneToOne(cascade = CascadeType.ALL)
	public Category getCategory() {
		return category;
	}

	/**
	 * @param category
	 *            the category to set
	 */
	public void setCategory(Category category) {
		this.category = category;
	}

	/**
	 * @return the subCategory
	 */
	@OneToOne(cascade = CascadeType.ALL)
	public SubCategory getSubCategory() {
		return subCategory;
	}

	/**
	 * @param subCategory
	 *            the subCategory to set
	 */
	public void setSubCategory(SubCategory subCategory) {
		this.subCategory = subCategory;
	}

	/**
	 * @return the product
	 */
	@OneToOne(cascade = CascadeType.ALL)
	public Product getProduct() {
		return product;
	}

	/**
	 * @param product
	 *            the product to set
	 */
	public void setProduct(Product product) {
		this.product = product;
	}

	/**
	 * @return the quantity
	 */
	public Integer getQuantity() {
		return quantity;
	}

	/**
	 * @param quantity
	 *            the quantity to set
	 */
	public void setQuantity(Integer quantity) {
		this.quantity = quantity;
	}

}
